]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Add hasUpdate state
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 22 Jan 2020 13:45:15 +0000 (14:45 +0100)
committerverdre <jonas@dressler.it>
Thu, 30 Jan 2020 13:37:47 +0000 (13:37 +0000)
The current support for extension updates is half-baked at best.
We are about to change that, and implement offline updates similar
to gnome-software.

As a first step, add a hasUpdate property to the extension state
which will communicate available updates.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/945

js/misc/extensionUtils.js
js/ui/extensionSystem.js

index 3d01ad787ce0bb049ea4d7012a8946b3a50ba151..af2338f450588370a39d1392e2c8687910be1ef7 100644 (file)
@@ -31,7 +31,15 @@ var ExtensionState = {
     UNINSTALLED: 99,
 };
 
-const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange'];
+const SERIALIZED_PROPERTIES = [
+    'type',
+    'state',
+    'path',
+    'error',
+    'hasPrefs',
+    'hasUpdate',
+    'canChange',
+];
 
 /**
  * getCurrentExtension:
index f7aca5ce9c6f458bc2403140be5f32432c50d0f6..49e333fffa52dd8698303968e1cc68a21317dab9 100644 (file)
@@ -198,6 +198,15 @@ var ExtensionManager = class {
         return true;
     }
 
+    notifyExtensionUpdate(uuid) {
+        let extension = this.lookup(uuid);
+        if (!extension)
+            return;
+
+        extension.hasUpdate = true;
+        this.emit('extension-state-changed', extension);
+    }
+
     logExtensionError(uuid, error) {
         let extension = this.lookup(uuid);
         if (!extension)
@@ -253,6 +262,7 @@ var ExtensionManager = class {
             path: dir.get_path(),
             error: '',
             hasPrefs: dir.get_child('prefs.js').query_exists(null),
+            hasUpdate: false,
             canChange: false,
         };
         this._extensions.set(uuid, extension);